# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  # Pick a unique cookie name to distinguish our session data from others'
  session :session_key => '_blog_app_session_id'
  
  # 필터 메소드는 레일스 어플리케이션 내부에서만 호출되어야 하므로, private 로 정의 한다. 
  private
  def check_login_status
    unless session[:user_id]
      redirect_to :controller => "login", :action => "login_form"
    end
  end
end
